Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 28, 2025

If there's an error during AST visitation, ensure state is reset to free memory.

This is only observable if user were to schedule some code in a later tick to access e.g. sourceCode.text, and that runs before the next file is linted. I've not added tests, as it'd be hard to write one which isn't flaky.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins labels Nov 28, 2025
Copy link
Member Author

overlookmotel commented Nov 28, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-bug Category - Bug label Nov 28, 2025
@overlookmotel overlookmotel force-pushed the 11-28-fix_linter_plugins_reset_state_after_error_during_ast_visitation branch from 4d8c1a9 to fdab22e Compare November 29, 2025 02:33
@overlookmotel overlookmotel marked this pull request as ready for review November 29, 2025 02:36
Copilot AI review requested due to automatic review settings November 29, 2025 02:36
Copilot finished reviewing on behalf of overlookmotel November 29, 2025 02:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a memory leak issue by ensuring that file processing state is properly cleaned up after errors during AST visitation. The fix extracts the cleanup logic into a dedicated resetFile() function and ensures it's called in the finally block of lintFile().

Key Changes:

  • Added resetFile() call in the finally block to ensure cleanup happens even when errors occur
  • Extracted reset logic into a separate documented function for better code organization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overlookmotel overlookmotel self-assigned this Nov 29, 2025
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 29, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 29, 2025

Merge activity

…16246)

If there's an error during AST visitation, ensure state is reset to free memory.

This is only observable if user were to schedule some code in a later tick to access e.g. `sourceCode.text`, and that runs before the next file is linted. I've not added tests, as it'd be hard to write one which isn't flaky.
@graphite-app graphite-app bot force-pushed the 11-28-fix_linter_plugins_reset_state_after_error_during_ast_visitation branch from fdab22e to 0df1901 Compare November 29, 2025 02:42
@graphite-app graphite-app bot merged commit 0df1901 into main Nov 29, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 11-28-fix_linter_plugins_reset_state_after_error_during_ast_visitation branch November 29, 2025 02:48
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants